Harden Strix fallback routing and large-diff completion handling#288
Harden Strix fallback routing and large-diff completion handling#288seonghobae with Copilot wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR hardens Strix quick-scan gating for large PR diffs and makes GitHub Models fallback routing more reliable by avoiding tool-incompatible models and classifying UnsupportedToolUse as a recoverable fallback condition.
Changes:
- Switched PR-scoped changed-line/diff intersection evaluation from env var (
DIFF_OUTPUT) to a temporary file to avoidArgument list too longafter large diffs. - Restricted GitHub Models fallbacks to tool-capable OpenAI models and removed DeepSeek routing for the tool-using workflow path.
- Updated fallback error classification and CI regression tests to allow continuing after
UnsupportedToolUse.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/ci/strix_quick_gate.sh | Uses temp-file diff parsing for changed-line overlap; classifies UnsupportedToolUse as a fallbackable GitHub Models availability failure. |
| .github/workflows/strix.yml | Narrows GitHub Models fallback list to github_models/openai/o3 and github_models/openai/gpt-5-chat. |
| scripts/ci/emit_opencode_failed_check_fallback_findings.sh | Updates failed-check guidance to match the new approved fallback list and remove DeepSeek suggestions. |
| scripts/ci/test_strix_quick_gate.sh | Updates shell test expectations and fake Strix scenarios for the new diff handling and fallback sequence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local diff_output_file | ||
| diff_output_file="$(mktemp "${TMPDIR:-/tmp}/strix-diff.XXXXXX")" || { | ||
| echo "ERROR: unable to create temporary diff file for changed-line evaluation." >&2 | ||
| return 1 | ||
| } | ||
| printf '%s' "$diff_output" >"$diff_output_file" | ||
| python3 - "$diff_output_file" "$start_line" "$end_line" <<'PY' | ||
| import re | ||
| import sys | ||
|
|
||
| target_start = int(sys.argv[1]) | ||
| target_end = int(sys.argv[2]) | ||
| diff_output_path = sys.argv[1] | ||
| target_start = int(sys.argv[2]) | ||
| target_end = int(sys.argv[3]) | ||
| hunk_re = re.compile(r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@") | ||
| for line in os.environ.get("DIFF_OUTPUT", "").splitlines(): | ||
| match = hunk_re.match(line) | ||
| if not match: | ||
| continue | ||
| start = int(match.group(1)) | ||
| count = int(match.group(2) or "1") | ||
| if count == 0: | ||
| continue | ||
| end = start + count - 1 | ||
| if start <= target_end and target_start <= end: | ||
| raise SystemExit(0) | ||
| with open(diff_output_path, "r", encoding="utf-8") as handle: | ||
| for raw_line in handle: | ||
| line = raw_line.rstrip("\n") | ||
| match = hunk_re.match(line) | ||
| if not match: | ||
| continue | ||
| start = int(match.group(1)) | ||
| count = int(match.group(2) or "1") | ||
| if count == 0: | ||
| continue | ||
| end = start + count - 1 | ||
| if start <= target_end and target_start <= end: | ||
| raise SystemExit(0) | ||
| raise SystemExit(1) | ||
| PY | ||
| local intersects_rc=$? | ||
| rm -f -- "$diff_output_file" | ||
| return "$intersects_rc" |
| if grep -Eiq '(UnsupportedToolUse|tool use\. Using tool is not supported by this model|Using tool is not supported by this model)' "$STRIX_LOG" && | ||
| grep -Eiq '(models\.github\.ai|GitHub Models|openai|OpenAIException)' "$STRIX_LOG"; then | ||
| return 0 | ||
| fi |
|
Superseded by #292, which carries this PR's four Strix fallback commits and adds the review-requested fixes for temp diff cleanup plus GitHub Models-specific UnsupportedToolUse fallback classification. Closing this non-maintainable branch keeps the central remediation path on the current, editable PR. |
Strix quick scans could report
Penetration test completedand still fail afterward while evaluating PR-scoped findings on large diffs. Separately, the GitHub Models fallback pool could select tool-incompatible models and stop recovery withUnsupportedToolUse.PR-scoped finding evaluation
DIFF_OUTPUT.Argument list too longafter a completed scan.GitHub Models fallback routing
github_models/openai/o3github_models/openai/gpt-5-chatFallback error classification
UnsupportedToolUseas a model-availability/provider-routing failure so the gate can continue to the next configured fallback instead of hard-stopping on the first incompatible candidate.Fallback diagnostics
Regression coverage
UnsupportedToolUserecovery